﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
     assembly="NHibernateDemo.DAL"
      namespace="NHibernateDemo.DAL.Entity">

    <class name="PersonBasic" lazy="true" >
        <cache region="Person" usage="read-write" include="all"/>
        <id name="PersonId" column="ManagerId">
            <!--<generator class="increment" />-->
            <generator class="native" />
        </id>
        <!--<property name="FirstName"  type="string" />
        <property name ="LastName" type="string"   />-->
        <property name ="Age" type="int"/>
        <component name="Name" class="NHibernateDemo.DAL.Entity.Name,NHibernateDemo.DAL" unique="true" >
            <property name="FirstName" column ="FirstName" type="string"
                                 length="50" not-null="true" />
            <property name ="LastName" column="LastName" type="string"
                                 length="50" not-null="false" />
        </component>
        <bag name="ManageFunds" generic="true" table="management" inverse ="true" cascade="save-update">
            <key column="PersonId" />
            <many-to-many class="FundBasic" column="FundId" />
        </bag>
        <!--<sql-insert>call add_person (?,?,?)</sql-insert>-->
    </class>
</hibernate-mapping>